package com.application.fabric.users.config;

import com.application.fabric.users.entity.Returnmsg;

import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.Map;

@Repository

public class Dealmsg {
    public Map<String,Object> successmsg(Returnmsg msg){
        Map<String,Object> map = new HashMap<>();
        map.put("code",200);
        map.put("msg","验证成功");
        map.put("data",msg.getData());
        return map;
    }


//    登陆失败信息
    public Map<String,Object> loginfailmsg(Returnmsg msg){
        Map<String,Object> map = new HashMap<>();
        map.put("code",404);
        map.put("msg","用户名或者密码错误");
        map.put("data",msg.getData());
        return map;
    }

//    注册成功信息
    public Map<String,Object> registersuccessmsg(){
        Map<String,Object> map = new HashMap<>();
        map.put("code",200);
        map.put("msg","注册成功");
        return map;
    }
//注册失败信息
    public Map<String,Object> registerfailmsg(){
        Map<String,Object> map = new HashMap<>();
        map.put("code",500);
        map.put("msg","用户名重复");
        return map;
    }



    public Map<String,Object> failmsg(){
        Map<String,Object> map = new HashMap<>();
        map.put("code",500);
        map.put("msg","运行时异常");
        map.put("data",null);
        return map;
    }
    public Map<String,Object> timeoutmsg(){
        Map<String,Object> map = new HashMap<>();
        map.put("code",400);
        map.put("msg","连接超时");
        map.put("data",null);
        return map;
    }

    public Map<String,Object> ioemsg(){
        Map<String,Object> map = new HashMap<>();
        map.put("code",500);
        map.put("msg","文件传输出现ioe异常");
        map.put("data",null);
        return map;
    }

//    token过期状态码返回
    public Map<String,Object> Tokentimeoutmsg(){
        Map<String,Object> map = new HashMap<>();
        map.put("code",401);
        map.put("msg","token exceed the time limit");
        return map;
    }

//    token空zhi判断
    public Map<String,Object> TokenIsNull(){
        Map<String,Object> map = new HashMap<>();
        map.put("code",404);
        map.put("msg","token is null");
        return map;
    }

//    token非法判断
    public Map<String,Object> Illegal(){
        Map<String,Object> map = new HashMap<>();
        map.put("code",403);
        map.put("msg","token is illegal");
        return map;
    }

//    验证码失败
    public Map<String,Object> picfail(){
        Map<String,Object> map = new HashMap<>();
        map.put("code",403);
        map.put("msg","pic input is fail");
        return map;
    }

    public Map<String,Object> picnull(){
        Map<String,Object> map = new HashMap<>();
        map.put("code",400);
        map.put("msg","pic input is null");
        return map;
    }
}
